package com.example.demo.service.impl;

import com.normalClasses.eye.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("logService")
public class LogService implements logNotes {

    Logger my_logger = LoggerFactory.getLogger(getClass());

    //if degree is not passed to the method, we set the degree to one which is the lowest level.
    //standard log: "degree: this is the information"
    @Override
    public void noteInfo(String info) {
        my_logger.info("5: " + info);//默认等级为5
    }

    @Override
    public void noteTrace(String trace) {
        my_logger.trace("5: " + trace);
    }

    @Override
    public void noteTrace(String trace, int degree) {
        my_logger.trace(String.valueOf(degree) + ": " + trace);
    }

    @Override
    public void noteInfo(String info, int degree) {
        my_logger.info(String.valueOf(degree) + ": " + info);

    }

    @Override
    public void noteWarn(String warning) {
        my_logger.warn("5: " + warning);

    }

    @Override
    public void noteWarn(String warning, int degree) {
        my_logger.warn(String.valueOf(degree) + ": " + warning);
    }

    @Override
    public void noteError(String error) {
        my_logger.error("5: " + error);

    }

    @Override
    public void noteError(String error, int degree) {
        my_logger.error(String.valueOf(degree) + ": " + error);

    }


    @Override
    public void noteDebug(String debug) {
        my_logger.debug("5: " + debug);
    }

    @Override
    public void noteDebug(String debug, int degree) {
        my_logger.debug(String.valueOf(degree) + ": " + debug);
    }

}